<?php
function auto($url){
$data = curl_init();
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $url);
$hasil = curl_exec($data);
curl_close($data);
return $hasil;
}
$access_token= "TOKEN";
if(file_exists('log')){ $log=json_encode(file('logs')); }else{ $log=''; }
$stat=json_decode(auto('https://graph.facebook.com/ID/feed?method=get&fields=id&limit=max&access_token='.$access_token),true);
for($i=1;$i<=count($stat[data]);$i++){
if(!ereg($stat[data][$i-1][id],$log)){
$x=$stat[data][$i-1][id]."\n";
$y=fopen('logs','a');
fwrite($y,$x);
fclose($y);
auto('https://graph.facebook.com/'.$stat[data][$i-1][id].'?method=delete&access_token='.$access_token);
echo '<span style="color:#3b5998">'.$stat[data][$i-1][from][name].'</span><span style="color:red">Has Been Deleted!</span><hr/>';
}
}
?>